import { DECREMENT, INCREMENT } from "../constant"

// 创建count的action
export const createCountIncrement = (data) => ({ type: INCREMENT, data })
export const createCountDecrement = (data) => ({ type: DECREMENT, data })
// 异步action 返回返回方法会自动执行
export const createCountDecrementAsync = (data,time) => {
    return (dispatch) => {
        setTimeout(() => {
            dispatch({ type: INCREMENT, data })
        }, time);
    }
}
